Skip to content

T1325067 — PivotGrid: Field Chooser — The "Cannot read properties of undefined (reading 'isMeasure')" error occurs when dragging fields while data is loading#33103

Merged
aleksei-semikozov merged 3 commits intoDevExpress:26_1from
aleksei-semikozov:pivotgrid-field-chooser-fix
Apr 2, 2026

Conversation

@aleksei-semikozov
Copy link
Copy Markdown
Contributor

No description provided.

@aleksei-semikozov aleksei-semikozov self-assigned this Mar 30, 2026
@aleksei-semikozov aleksei-semikozov marked this pull request as ready for review April 2, 2026 01:25
Copilot AI review requested due to automatic review settings April 2, 2026 01:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a PivotGrid Field Chooser drag-and-drop crash (Cannot read properties of undefined (reading 'isMeasure')) that can occur when fields are dragged while the underlying data is still loading, by guarding the drag-cancel decision against missing field data.

Changes:

  • Extracted drag-cancel logic into a new shouldCancelDragging utility that safely handles an undefined field.
  • Updated Field Chooser drag handler to use shouldCancelDragging instead of directly accessing field.isMeasure.
  • Added unit tests covering the new drag-cancel decision logic.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/devextreme/js/__internal/grids/pivot_grid/field_chooser/utils.ts Adds shouldCancelDragging to centralize and null-guard drag cancellation logic.
packages/devextreme/js/__internal/grids/pivot_grid/field_chooser/m_field_chooser_base.ts Uses the new helper in onDragging to prevent field.isMeasure access on undefined.
packages/devextreme/js/__internal/grids/pivot_grid/field_chooser/utils.test.ts Introduces Jest coverage for shouldCancelDragging.

@aleksei-semikozov aleksei-semikozov merged commit 6fb407d into DevExpress:26_1 Apr 2, 2026
102 checks passed
aleksei-semikozov added a commit to aleksei-semikozov/DevExtreme that referenced this pull request Apr 2, 2026
…undefined (reading 'isMeasure')" error occurs when dragging fields while data is loading (DevExpress#33103)
aleksei-semikozov added a commit to aleksei-semikozov/DevExtreme that referenced this pull request Apr 2, 2026
…undefined (reading 'isMeasure')" error occurs when dragging fields while data is loading (DevExpress#33103)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants